/**   
 * @Title: FootballHemaiGetDetailCommunicater.java 
 * @Package com.esun.rabbit2.communicaters 
 * @Description: (通讯接口,业务标号10042) 
 * @author: Kuroky Chengxt@500wan.com   
 * @date: 2011-8-17 下午02:27:38  
 * Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.hemaicenter;

import java.util.ArrayList;
import java.util.HashMap;

import com.esun.config.BussinessCode;
import com.esun.config.Config;
import com.esun.config.Key;
import com.esun.config.Language;
import com.esun.model.UserInfo;
import com.esun.network.ServerCommunicater;

/**
 * @ClassName: Fucai3DHemaiGetDetailCommunicater
 * @Description: (获取竞彩足球合买详细内容)
 * @author: Kuroky Chengxt@500wan.com
 * @date: 2011-11-27 下午02:27:38
 * 
 */
public class Fucai3DHemaiGetDetailCommunicater extends ServerCommunicater {
	private String msgServer; // 服务器信息
	private boolean isSucceed = false;

	public String getMsgServer() {
		return msgServer;
	}

	public void setMsgServer(String msgServer) {
		this.msgServer = msgServer;
	}

	public boolean isGetDetailSucced(String lotId, String programId) {
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
		list.add(mapItem(BussinessCode.PASER_MID, BussinessCode.MID_HEMAI_DETIAL_FUCAI));
		list.add(mapItem(BussinessCode.PASER_CK, UserInfo.getUserInfo().getUserSession()));
		list.add(mapItem(Key.KEY_LOTID, lotId));
		list.add(mapItem(Key.KEY_PID, programId));
		try {
			// 写入服务器返回信息
			super.getServerResponse(list, true);
			setMsgServer(super.getErrorMSG());
			if (super.getState() == 100) {
				isSucceed = true;
			} else {
				isSucceed = false;
			}
		} catch (Exception e) {
			isSucceed = false;
			setMsgServer(Language.STR_CONNECTIONFAIL);
		}
		return isSucceed;
	}

	public void updateHemaiDetailInfo() {

		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setAddTime(super.getResult().get(Key.KEY_ADDTIME));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setAllCount(super.getResult().get(Key.KEY_ANUMBER));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setAllMoney(super.getResult().get(Key.KEY_ALLMONEY));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setBaodiMoney(super.getResult().get(Key.KEY_BAODIMONEY));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setBeishu(super.getResult().get(Key.KEY_BEISHU));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setEachMoney(super.getResult().get(Key.KEY_ONEMONEY));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setHitCount(super.getResult().get(Key.KEY_LOTTERYCOUNT));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setHitMoney(super.getResult().get(Key.KEY_LOTTERYMONERY));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setJindu(super.getResult().get(Key.KEY_RENQI));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setLeftCount(super.getResult().get(Key.KEY_LEFTNUMBER));
		if (super.getResult().get(Key.KEY_ISMANYUAN).equals(Config.NUM1)) {
			Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setState(Language.POPLOTTERYTIP_MANYUAN);
		} else {
			Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setState(Language.POPLOTTERYTIP_WEIMANYUAN);
		}
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setStrFaqiren(super.getResult().get(Key.KEY_USERNAME));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setTicheng(super.getResult().get(Key.KEY_TICHENG));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setIssuc(super.getResult().get(Key.KEY_ISSUC));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setIsShow(super.getResult().get(Key.KEY_ISSHOW));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setFileorcode(super.getResult().get(Key.KEY_FILEORCODE));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setIsUpload(super.getResult().get(Key.KEY_ISUPLOAD));
		Fucai3DHemaiDetailInfo.getHemaiDetailInfo().setIsChaser(super.getResult().get(Key.KEY_ISCHASER));

	}

	/**
	 * @Title: mapItem
	 * @Description: (工具类,用于构建AraayList单条内容)
	 * @param @param name 参数名
	 * @param @param value 参数值
	 * @param @return map
	 * @return HashMap<String,String> 返回类型
	 * @throws
	 */
	private HashMap<String, String> mapItem(String name, String value) {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put(name, value);
		return map;
	}

}
